<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="dao.Products" %>
    <%@page import="model.ProductModel" %>
    <%@page import="java.util.List" %>
    <%
    Products p = new Products();
    String id = request.getParameter("query");
	List<ProductModel> pm = p.ListProducts();
    %>
{"totalCount":"<%=pm.size() %>","topics":[
	<%
		for(ProductModel goods:pm){
			%>
				{"id":"<%=goods.getId() %>", "name":"<%=goods.getName() %>", "price":"<%=goods.getPrice() %>"},
			<%
		}
	%>
]}